<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<title>Determination Types</title>
<link href="../docs-assets/Breadcrumbs.css" rel="stylesheet" rev="stylesheet" type="text/css">
		<meta name="viewport" content="width=device-width initial-scale=1">
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<meta http-equiv="Content-Language" content="en-gb">

<link href="../docs-assets/Contents.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Progress.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Navigation.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Fonts.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Base.css" rel="stylesheet" rev="stylesheet" type="text/css">
<script>
function togglePopup(material_id) {
  var popup = document.getElementById(material_id);
  popup.classList.toggle("show");
}
</script>

<link href="../docs-assets/Popups.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Colours.css" rel="stylesheet" rev="stylesheet" type="text/css">
		
	</head>
	<body class="commentary-font">
		<nav role="navigation">
		<h1><a href="../index.html"><img src="../docs-assets/Inform.png" height=72> </a></h1>
<ul><li><a href="../index.html">home</a></li>
</ul><h2>Compiler</h2><ul>
<li><a href="../structure.html">structure</a></li>
<li><a href="../inbuildn.html">inbuild</a></li>
<li><a href="../inform7n.html">inform7</a></li>
<li><a href="../intern.html">inter</a></li>
<li><a href="../services.html">services</a></li>
<li><a href="../secrets.html">secrets</a></li>
</ul><h2>Other Tools</h2><ul>
<li><a href="../inblorbn.html">inblorb</a></li>
<li><a href="../inform6.html">inform6</a></li>
<li><a href="../inpolicyn.html">inpolicy</a></li>
</ul><h2>Resources</h2><ul>
<li><a href="../extensions.html">extensions</a></li>
<li><a href="../kits.html">kits</a></li>
</ul><h2>Repository</h2><ul>
<li><a href="https://github.com/ganelson/inform"><img src="../docs-assets/github.png" height=0> github</a></li>
</ul><h2>Related Projects</h2><ul>
<li><a href="https://github.com/ganelson/inweb"><img src="../docs-assets/github.png" height=0> inweb</a></li>
<li><a href="https://github.com/ganelson/intest"><img src="../docs-assets/github.png" height=0> intest</a></li>
</ul>
		</nav>
		<main role="main">
		<!-- Weave of 'Determination Types' generated by inweb -->
<div class="breadcrumbs">
    <ul class="crumbs"><li><a href="../index.html">Home</a></li><li><a href="../inform7n.html">Inform7</a></li><li><a href="index.html">if</a></li><li><a href="index.html#5">Chapter 5: Command Parser</a></li><li><b>Determination Types</b></li></ul></div>
<p class="purpose">Command grammars, their lines and their tokens may each "determine" up to two values, and here we provide a way to describe the range of those.</p>

<p class="commentary firstcommentary"><a id="SP1" class="paragraph-anchor"></a><b>&#167;1. </b>Determination is the process by which Inform looks at a command grammar,
or a line in one, or a token in one of those lines, and works out what value
or values this grammar is talking about. Those could be specific values or
whole kinds, and so we use a specification &mdash; which will always be an rvalue
or a description &mdash; for each value.
</p>

<p class="commentary">For example, the grammar line created in:
</p>

<blockquote>
    <p>Understand "put [other things] on/onto [something]" as putting it on.</p>
</blockquote>

<p class="commentary">has a determination type with two terms, one a description of <span class="extract"><span class="extract-syntax">K_thing</span></span> with
multiplicity <span class="extract"><span class="extract-syntax">TRUE</span></span>, and the other a description of <span class="extract"><span class="extract-syntax">K_thing</span></span> without.
</p>

<pre class="definitions code-font"><span class="definition-keyword">define</span> <span class="constant-syntax">MAX_DETERMINATION_TYPE_TERMS</span><span class="plain-syntax"> </span><span class="constant-syntax">2</span>
</pre>
<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">typedef</span><span class="plain-syntax"> </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="reserved-syntax">determination_type</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">no_values_described</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="reserved-syntax">determination_type_term</span><span class="plain-syntax"> </span><span class="identifier-syntax">term</span><span class="plain-syntax">[</span><span class="constant-syntax">MAX_DETERMINATION_TYPE_TERMS</span><span class="plain-syntax">];</span>
<span class="plain-syntax">} </span><span class="reserved-syntax">determination_type</span><span class="plain-syntax">;</span>

<span class="reserved-syntax">typedef</span><span class="plain-syntax"> </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="reserved-syntax">determination_type_term</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="identifier-syntax">parse_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">what</span><span class="plain-syntax">; </span><span class="comment-syntax"> always an rvalue or a description</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">multiplicity</span><span class="plain-syntax">; </span><span class="comment-syntax"> relevant for lines only: allow a multiple object here?</span>
<span class="plain-syntax">} </span><span class="reserved-syntax">determination_type_term</span><span class="plain-syntax">;</span>

<span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="function-syntax">DeterminationTypes::get_no_values_described</span><button class="popup" onclick="togglePopup('usagePopup1')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup1">Usage of <span class="code-font"><span class="function-syntax">DeterminationTypes::get_no_values_described</span></span>:<br/>Command Grammar Lines - <a href="5-cgl.html#SP16_1">&#167;16.1</a>, <a href="5-cgl.html#SP16_2">&#167;16.2</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">determination_type</span><span class="plain-syntax"> *</span><span class="identifier-syntax">gty</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">gty</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">no_values_described</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>

<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">DeterminationTypes::log</span><button class="popup" onclick="togglePopup('usagePopup2')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup2">Usage of <span class="code-font"><span class="function-syntax">DeterminationTypes::log</span></span>:<br/>Command Grammar Lines - <a href="5-cgl.html#SP16">&#167;16</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">determination_type</span><span class="plain-syntax"> *</span><span class="identifier-syntax">dt</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">dt</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) </span><span class="identifier-syntax">LOG</span><span class="plain-syntax">(</span><span class="string-syntax">"&lt;no-dt&gt;"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">dt</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">no_values_described</span><span class="plain-syntax"> == </span><span class="constant-syntax">0</span><span class="plain-syntax">) </span><span class="identifier-syntax">LOG</span><span class="plain-syntax">(</span><span class="string-syntax">"void"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">t</span><span class="plain-syntax">=0; </span><span class="identifier-syntax">t</span><span class="function-syntax">&lt;dt-&gt;</span><span class="element-syntax">no_values_described</span><span class="plain-syntax">; </span><span class="identifier-syntax">t</span><span class="plain-syntax">++)</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">LOG</span><span class="plain-syntax">(</span><span class="string-syntax">"%s%d:$P%s"</span><span class="plain-syntax">, (</span><span class="identifier-syntax">t</span><span class="plain-syntax">&gt;0)?</span><span class="string-syntax">" "</span><span class="plain-syntax">:</span><span class="string-syntax">""</span><span class="plain-syntax">, </span><span class="identifier-syntax">t</span><span class="plain-syntax">, </span><span class="identifier-syntax">dt</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">term</span><span class="plain-syntax">[</span><span class="identifier-syntax">t</span><span class="plain-syntax">].</span><span class="element-syntax">what</span><span class="plain-syntax">,</span>
<span class="plain-syntax">            (</span><span class="identifier-syntax">dt</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">term</span><span class="plain-syntax">[</span><span class="identifier-syntax">t</span><span class="plain-syntax">].</span><span class="element-syntax">multiplicity</span><span class="plain-syntax">)?</span><span class="string-syntax">"(multiple)"</span><span class="plain-syntax">:</span><span class="string-syntax">""</span><span class="plain-syntax">);</span>
<span class="plain-syntax">}</span>
</pre>
<ul class="endnotetexts"><li>The structure determination_type is private to this section.</li><li>The structure determination_type_term is private to this section.</li></ul>
<p class="commentary firstcommentary"><a id="SP2" class="paragraph-anchor"></a><b>&#167;2. </b>This function returns the equivalent of the <span class="extract"><span class="extract-syntax">void</span></span> type in C: something
which describes no values at all.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">determination_type</span><span class="plain-syntax"> </span><span class="function-syntax">DeterminationTypes::new</span><button class="popup" onclick="togglePopup('usagePopup3')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup3">Usage of <span class="code-font"><span class="function-syntax">DeterminationTypes::new</span></span>:<br/>Command Grammars - <a href="5-cg.html#SP4">&#167;4</a><br/>Command Grammar Lines - <a href="5-cgl.html#SP2">&#167;2</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">void</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">determination_type</span><span class="plain-syntax"> </span><span class="identifier-syntax">gty</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">t</span><span class="plain-syntax">=0; </span><span class="identifier-syntax">t</span><span class="plain-syntax">&lt;</span><span class="constant-syntax">MAX_DETERMINATION_TYPE_TERMS</span><span class="plain-syntax">; </span><span class="identifier-syntax">t</span><span class="plain-syntax">++) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">gty</span><span class="plain-syntax">.</span><span class="element-syntax">term</span><span class="plain-syntax">[</span><span class="identifier-syntax">t</span><span class="plain-syntax">].</span><span class="element-syntax">what</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">gty</span><span class="plain-syntax">.</span><span class="element-syntax">term</span><span class="plain-syntax">[</span><span class="identifier-syntax">t</span><span class="plain-syntax">].</span><span class="element-syntax">multiplicity</span><span class="plain-syntax"> = </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">gty</span><span class="plain-syntax">.</span><span class="element-syntax">no_values_described</span><span class="plain-syntax"> = </span><span class="constant-syntax">0</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">gty</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP3" class="paragraph-anchor"></a><b>&#167;3. </b>And then call this to make more interesting DTs:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">DeterminationTypes::add_term</span><button class="popup" onclick="togglePopup('usagePopup4')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup4">Usage of <span class="code-font"><span class="function-syntax">DeterminationTypes::add_term</span></span>:<br/>Command Grammar Lines - <a href="5-cgl.html#SP16_1">&#167;16.1</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">determination_type</span><span class="plain-syntax"> *</span><span class="identifier-syntax">gty</span><span class="plain-syntax">, </span><span class="identifier-syntax">parse_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">spec</span><span class="plain-syntax">,</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">multiple_flag</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">gty</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">no_values_described</span><span class="plain-syntax"> &gt;= </span><span class="constant-syntax">MAX_DETERMINATION_TYPE_TERMS</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">StandardProblems::sentence_problem</span><span class="plain-syntax">(</span><span class="identifier-syntax">Task::syntax_tree</span><span class="plain-syntax">(),</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">_p_</span><span class="plain-syntax">(</span><span class="identifier-syntax">PM_ThreeValuedLine</span><span class="plain-syntax">),</span>
<span class="plain-syntax">            </span><span class="string-syntax">"there can be at most two varying parts to a line of grammar"</span><span class="plain-syntax">,</span>
<span class="plain-syntax">            </span><span class="string-syntax">"so 'put [something] in [a container]' is allowed but 'put "</span>
<span class="plain-syntax">            </span><span class="string-syntax">"[something] in [something] beside [a door]' is not."</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">gty</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">term</span><span class="plain-syntax">[</span><span class="identifier-syntax">gty</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">no_values_described</span><span class="plain-syntax">].</span><span class="element-syntax">what</span><span class="plain-syntax"> = </span><span class="identifier-syntax">spec</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">gty</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">term</span><span class="plain-syntax">[</span><span class="identifier-syntax">gty</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">no_values_described</span><span class="plain-syntax">].</span><span class="element-syntax">multiplicity</span><span class="plain-syntax"> = </span><span class="identifier-syntax">multiple_flag</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">gty</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">no_values_described</span><span class="plain-syntax">++;</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP4" class="paragraph-anchor"></a><b>&#167;4. </b>When dealing with grammar describing just a single value, these functions
are convenient:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="identifier-syntax">parse_node</span><span class="plain-syntax"> *</span><span class="function-syntax">DeterminationTypes::get_single_term</span><button class="popup" onclick="togglePopup('usagePopup5')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup5">Usage of <span class="code-font"><span class="function-syntax">DeterminationTypes::get_single_term</span></span>:<br/>Command Grammars - <a href="5-cg.html#SP20_1">&#167;20.1</a>, <a href="5-cg.html#SP20_3">&#167;20.3</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">determination_type</span><span class="plain-syntax"> *</span><span class="identifier-syntax">gty</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">gty</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">no_values_described</span><span class="plain-syntax"> == </span><span class="constant-syntax">1</span><span class="plain-syntax">) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">gty</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">term</span><span class="plain-syntax">[0].</span><span class="element-syntax">what</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>

<span class="identifier-syntax">kind</span><span class="plain-syntax"> *</span><span class="function-syntax">DeterminationTypes::get_single_kind</span><button class="popup" onclick="togglePopup('usagePopup6')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup6">Usage of <span class="code-font"><span class="function-syntax">DeterminationTypes::get_single_kind</span></span>:<br/>Command Grammars - <a href="5-cg.html#SP18">&#167;18</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">determination_type</span><span class="plain-syntax"> *</span><span class="identifier-syntax">gty</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">gty</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">no_values_described</span><span class="plain-syntax"> == </span><span class="constant-syntax">1</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">gty</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">term</span><span class="plain-syntax">[0].</span><span class="element-syntax">what</span><span class="plain-syntax">))</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">Specifications::to_kind</span><span class="plain-syntax">(</span><span class="identifier-syntax">gty</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">term</span><span class="plain-syntax">[0].</span><span class="element-syntax">what</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>

<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">DeterminationTypes::set_single_term</span><button class="popup" onclick="togglePopup('usagePopup7')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup7">Usage of <span class="code-font"><span class="function-syntax">DeterminationTypes::set_single_term</span></span>:<br/>Command Grammars - <a href="5-cg.html#SP20_4">&#167;20.4</a><br/>Command Grammar Lines - <a href="5-cgl.html#SP8">&#167;8</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">determination_type</span><span class="plain-syntax"> *</span><span class="identifier-syntax">gty</span><span class="plain-syntax">, </span><span class="identifier-syntax">parse_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">spec</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">spec</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">gty</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">no_values_described</span><span class="plain-syntax"> = </span><span class="constant-syntax">0</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">gty</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">no_values_described</span><span class="plain-syntax"> = </span><span class="constant-syntax">1</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">gty</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">term</span><span class="plain-syntax">[0].</span><span class="element-syntax">what</span><span class="plain-syntax"> = </span><span class="identifier-syntax">spec</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">gty</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">term</span><span class="plain-syntax">[0].</span><span class="element-syntax">multiplicity</span><span class="plain-syntax"> = </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP5" class="paragraph-anchor"></a><b>&#167;5. </b>The behaviour of this sorting function is documented in the discussion
of CGL sorting in <a href="5-cgl.html" class="internal">Command Grammar Lines</a>.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="function-syntax">DeterminationTypes::must_precede</span><button class="popup" onclick="togglePopup('usagePopup8')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup8">Usage of <span class="code-font"><span class="function-syntax">DeterminationTypes::must_precede</span></span>:<br/>Command Grammar Lines - <a href="5-cgl.html#SP19_7">&#167;19.7</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">determination_type</span><span class="plain-syntax"> *</span><span class="identifier-syntax">gty1</span><span class="plain-syntax">, </span><span class="reserved-syntax">determination_type</span><span class="plain-syntax"> *</span><span class="identifier-syntax">gty2</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">gty1</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">no_values_described</span><span class="plain-syntax">) &lt; (</span><span class="identifier-syntax">gty2</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">no_values_described</span><span class="plain-syntax">)) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">gty1</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">no_values_described</span><span class="plain-syntax">) &gt; (</span><span class="identifier-syntax">gty2</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">no_values_described</span><span class="plain-syntax">)) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>

<span class="plain-syntax">    </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">t</span><span class="plain-syntax">=0; </span><span class="identifier-syntax">t</span><span class="plain-syntax">&lt;</span><span class="constant-syntax">MAX_DETERMINATION_TYPE_TERMS</span><span class="plain-syntax">; </span><span class="identifier-syntax">t</span><span class="plain-syntax">++) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">gty1</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">no_values_described</span><span class="plain-syntax"> == </span><span class="identifier-syntax">t</span><span class="plain-syntax">) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">NOT_APPLICABLE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">cs</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Specifications::compare_specificity</span><span class="plain-syntax">(</span><span class="identifier-syntax">gty1</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">term</span><span class="plain-syntax">[</span><span class="identifier-syntax">t</span><span class="plain-syntax">].</span><span class="element-syntax">what</span><span class="plain-syntax">, </span><span class="identifier-syntax">gty2</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">term</span><span class="plain-syntax">[</span><span class="identifier-syntax">t</span><span class="plain-syntax">].</span><span class="element-syntax">what</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">cs</span><span class="plain-syntax"> == </span><span class="constant-syntax">1</span><span class="plain-syntax">) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">cs</span><span class="plain-syntax"> == -1) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">gty1</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">term</span><span class="plain-syntax">[</span><span class="identifier-syntax">t</span><span class="plain-syntax">].</span><span class="element-syntax">multiplicity</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">gty2</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">term</span><span class="plain-syntax">[</span><span class="identifier-syntax">t</span><span class="plain-syntax">].</span><span class="element-syntax">multiplicity</span><span class="plain-syntax"> == </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">))</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">gty1</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">term</span><span class="plain-syntax">[</span><span class="identifier-syntax">t</span><span class="plain-syntax">].</span><span class="element-syntax">multiplicity</span><span class="plain-syntax"> == </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">gty2</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">term</span><span class="plain-syntax">[</span><span class="identifier-syntax">t</span><span class="plain-syntax">].</span><span class="element-syntax">multiplicity</span><span class="plain-syntax">))</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>

<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">NOT_APPLICABLE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<nav role="progress"><div class="progresscontainer">
    <ul class="progressbar"><li class="progressprev"><a href="5-cgt.html">&#10094;</a></li><li class="progresschapter"><a href="P-wtmd.html">P</a></li><li class="progresschapter"><a href="1-im.html">1</a></li><li class="progresschapter"><a href="2-bd.html">2</a></li><li class="progresschapter"><a href="3-sm.html">3</a></li><li class="progresschapter"><a href="4-ap.html">4</a></li><li class="progresscurrentchapter">5</li><li class="progresssection"><a href="5-pp.html">pp</a></li><li class="progresssection"><a href="5-us.html">us</a></li><li class="progresssection"><a href="5-cg.html">cg</a></li><li class="progresssection"><a href="5-cgl.html">cgl</a></li><li class="progresssection"><a href="5-cgt.html">cgt</a></li><li class="progresscurrent">dt</li><li class="progresssection"><a href="5-pv.html">pv</a></li><li class="progresssection"><a href="5-ts.html">ts</a></li><li class="progresschapter"><a href="6-dlg.html">6</a></li><li class="progressnext"><a href="5-pv.html">&#10095;</a></li></ul></div>
</nav><!-- End of weave -->

		</main>
	</body>
</html>

